# encoding: utf-8

# 求第n项的值
def f(n):
    # 递归出口
    if n <= 3:
        return 1
    return f(n - 1) + f(n - 2) + f(n - 3)


if __name__ == '__main__':
    result = [0] * 20  # 创建一个列表保存答案
    # 计算第[1,21)项，即1-20项
    for i in range(1,21):
        result[i - 1] = f(i)
    print(result)